package com.brayan.webapp.controller.cdi;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;

import org.apache.log4j.Logger;

/**
 * This class prepares (produces) all the injectable instances.
 * 
 * @author Brayan
 * 
 */
@Dependent
public class Resources {
    // use @SuppressWarnings to tell IDE to ignore warnings about field not being referenced directly
//    @SuppressWarnings("unused")
//    @Produces
//    @PersistenceContext
//    private EntityManager em;

    @Produces
    public Logger produceLog(InjectionPoint injectionPoint) {
        return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
    }

//    @Produces
//    @RequestScoped
//    public FacesContext produceFacesContext() {
//        return FacesContext.getCurrentInstance();
//    }
}
